export function debounceTest<T extends (...args:any[])=>any>(
    func:T,
    delay:number
):(...args:Parameters<T>)=>any{
    let timeoutId : number | null = null ;

    return function(...args:Parameters<T>){
        if(timeoutId){
            clearTimeout(timeoutId)
        }

        timeoutId=setTimeout(()=>{
            func(...args)
            timeoutId = null;
        },delay)
    }
}